1 00:00:00,990 --> 00:00:06,450 So I've been playing around with my game trying to test the performance of it, and these coins kind 2 00:00:06,450 --> 00:00:07,620 of pushed it over the edge. 3 00:00:07,650 --> 00:00:09,080 So, yeah, a glitch there. 4 00:00:09,090 --> 00:00:10,110 That's no good. 5 00:00:10,110 --> 00:00:14,130 We're not even close to done, so we're going to have to do some optimization. 6 00:00:14,550 --> 00:00:18,630 I'm going to look at my performance real quick and yours might be closed up. 7 00:00:18,630 --> 00:00:20,350 It might look like this, right? 8 00:00:20,400 --> 00:00:24,000 So you can open your performance, open your memory. 9 00:00:24,000 --> 00:00:27,630 If it's closed, you have core memory, place, memory. 10 00:00:27,630 --> 00:00:31,950 And you might want to take snapshots of this stuff while you're optimizing. 11 00:00:31,950 --> 00:00:36,960 I'm not going to go through all of it, but you'll get familiar with the ones where you're kind of guilty 12 00:00:36,960 --> 00:00:37,350 at. 13 00:00:37,360 --> 00:00:40,830 Now, we haven't done any network stuff, so I'm not worried about that. 14 00:00:41,660 --> 00:00:43,370 Let's look at our workspace. 15 00:00:43,850 --> 00:00:45,570 Our frames per second looks good. 16 00:00:45,590 --> 00:00:47,180 Heart rate looks good. 17 00:00:48,080 --> 00:00:49,610 Kind of died there for a second. 18 00:00:50,690 --> 00:00:52,220 Open the world primitives. 19 00:00:52,250 --> 00:00:53,540 Way too many primitives. 20 00:00:53,540 --> 00:00:56,330 We have too small buildings. 21 00:00:56,330 --> 00:00:56,570 Right. 22 00:00:56,630 --> 00:00:59,090 So we're going to have to get rid of some of these coins. 23 00:00:59,090 --> 00:01:01,310 Let's do some optimization now. 24 00:01:03,350 --> 00:01:06,530 When I close my performance window, I turn off my game. 25 00:01:07,830 --> 00:01:11,730 I'm going to go to my wave loop, which is under server script server. 26 00:01:12,410 --> 00:01:13,310 Service. 27 00:01:13,430 --> 00:01:14,200 There we go. 28 00:01:14,200 --> 00:01:15,050 A wave loop. 29 00:01:15,440 --> 00:01:21,720 And we got 1000 coins, a lot of coins, each with their own rotate script going around. 30 00:01:21,740 --> 00:01:23,300 Let's make that, like 250. 31 00:01:23,510 --> 00:01:25,430 Also on the coin. 32 00:01:25,850 --> 00:01:27,110 Let's take a look at our coin. 33 00:01:27,140 --> 00:01:28,790 It's in server storage. 34 00:01:29,600 --> 00:01:30,480 Coin. 35 00:01:31,220 --> 00:01:32,300 I'm going to go to properties. 36 00:01:32,300 --> 00:01:36,700 I'm going to search for cast, cast, shadow. 37 00:01:36,710 --> 00:01:39,140 Those coins don't need to cast a shadow. 38 00:01:39,140 --> 00:01:42,860 So that's one more thing we don't have to worry about for our resources. 39 00:01:43,130 --> 00:01:43,490 All right. 40 00:01:43,490 --> 00:01:45,530 The health pickups aren't that bad. 41 00:01:45,530 --> 00:01:47,150 Land mines aren't that bad. 42 00:01:47,420 --> 00:01:51,710 I think I'm going to reduce those land mines. 43 00:01:52,370 --> 00:01:54,000 I maybe we'll do well. 44 00:01:54,020 --> 00:01:56,930 Let's keep 15, but distance from sign. 45 00:01:56,930 --> 00:01:58,850 Maybe I'll stretch that out a little bit. 46 00:01:58,850 --> 00:02:01,850 We're getting kind of cluttered a number of health's. 47 00:02:01,850 --> 00:02:02,810 We can reduce that. 48 00:02:02,810 --> 00:02:04,010 We have a whole bunch of health. 49 00:02:04,340 --> 00:02:06,830 We're just kind of showing recasting on that. 50 00:02:07,880 --> 00:02:10,400 And let's look at our wave loop. 51 00:02:10,580 --> 00:02:14,330 The that that eruption goes off way too many times. 52 00:02:15,050 --> 00:02:18,080 So you could make this a random number. 53 00:02:18,470 --> 00:02:20,180 Instead of using wave loop. 54 00:02:20,300 --> 00:02:22,550 And I think I'm going to. 55 00:02:23,530 --> 00:02:30,970 Increase our distance between firing the eruption maybe every 15th wave loop. 56 00:02:31,750 --> 00:02:33,340 All right, what else should I do? 57 00:02:33,370 --> 00:02:34,960 Let's go to our session. 58 00:02:34,960 --> 00:02:35,950 Utils. 59 00:02:36,640 --> 00:02:39,190 One thing I noticed in session utils. 60 00:02:40,280 --> 00:02:42,890 Right here under our place coin. 61 00:02:42,890 --> 00:02:48,260 This is a little bit energy intensive with our cast down array, but we do need it because we have that 62 00:02:48,260 --> 00:02:50,120 hill and. 63 00:02:50,740 --> 00:02:56,360 We are killing off most of the coins at 5 minutes. 64 00:02:56,380 --> 00:02:59,620 If you have a lot of players getting them, that's going to be different. 65 00:02:59,620 --> 00:03:02,980 So we're going to be able to put coins in over time. 66 00:03:02,980 --> 00:03:06,880 But on startup, we're going to put like 250 coins in at once. 67 00:03:06,910 --> 00:03:10,450 Let's go ahead and make this a random time to live. 68 00:03:10,960 --> 00:03:13,870 So we have a random number generator named R. 69 00:03:14,920 --> 00:03:23,580 We'll do a next end and then say 300 to 500, maybe 1000. 70 00:03:23,590 --> 00:03:26,020 Now we'll do 6/602. 71 00:03:26,020 --> 00:03:28,860 So that's 5 minutes to 10 minutes. 72 00:03:28,870 --> 00:03:31,100 Sorry about bumbling like that. 73 00:03:31,120 --> 00:03:33,070 Let's go ahead and copy that, Control. 74 00:03:33,070 --> 00:03:33,850 See? 75 00:03:35,860 --> 00:03:37,930 And then maybe down here. 76 00:03:38,350 --> 00:03:41,470 Control V will do that with the health's. 77 00:03:42,610 --> 00:03:44,290 And then place mines is fine. 78 00:03:44,290 --> 00:03:45,840 That already has a random number. 79 00:03:45,850 --> 00:03:47,560 Let's just go ahead and increase that there. 80 00:03:47,560 --> 00:03:49,420 Let's make that 300. 81 00:03:50,550 --> 00:03:53,310 To 605 minutes to 10 minutes. 82 00:03:54,470 --> 00:04:01,340 And I think I'm going to do one more thing under these coins since we have like 251 responding. 83 00:04:01,520 --> 00:04:03,320 Let's just put a tiny weight in there. 84 00:04:03,320 --> 00:04:05,720 That's what, 0.0 3 seconds. 85 00:04:05,840 --> 00:04:11,360 But that's going to that's going to make it so we don't exhaust our resources for that period of time 86 00:04:11,360 --> 00:04:13,070 where we do our 200 coins. 87 00:04:13,310 --> 00:04:13,610 All right. 88 00:04:13,610 --> 00:04:15,860 Let's try this out and see what we got. 89 00:04:20,870 --> 00:04:22,860 And it's too early to tell. 90 00:04:22,880 --> 00:04:26,630 We have to wait for an eruption to go off and some coins to pop up. 91 00:04:27,950 --> 00:04:28,850 It's looking good. 92 00:04:28,850 --> 00:04:30,020 It's feeling good. 93 00:04:30,050 --> 00:04:31,670 I'm not getting a lot of glitches. 94 00:04:32,330 --> 00:04:36,530 Our performance, I didn't take a snapshot, but we can we can take a quick look. 95 00:04:38,240 --> 00:04:40,100 It doesn't look that much different here. 96 00:04:40,100 --> 00:04:41,600 Let's take a look at our workspace. 97 00:04:43,100 --> 00:04:45,620 And this heartbeat is not dying out. 98 00:04:46,830 --> 00:04:47,130 Here goes. 99 00:04:47,250 --> 00:04:47,670 Here goes. 100 00:04:47,670 --> 00:04:48,450 Interruption. 101 00:04:49,200 --> 00:04:49,950 Let's take a look at our world. 102 00:04:50,930 --> 00:04:53,840 So 433 parameters, that's a lot better. 103 00:04:53,990 --> 00:04:56,000 There's a coin I can run real fast. 104 00:04:58,700 --> 00:05:00,370 Yeah, this is working pretty good. 105 00:05:00,380 --> 00:05:01,160 I'm not. 106 00:05:01,160 --> 00:05:03,620 I'm not experiencing any glitching. 107 00:05:06,050 --> 00:05:06,700 Cool. 108 00:05:06,710 --> 00:05:12,410 So you'll have to keep keep that in mind, keep playing your game as you're adding stuff to it and then 109 00:05:12,410 --> 00:05:13,630 play it on Roadblocks. 110 00:05:13,640 --> 00:05:16,970 Also, even though it's private, you'll still be able to get it. 111 00:05:16,970 --> 00:05:22,460 So you want to keep up with that because you don't want to have an entire game and then realize rats. 112 00:05:22,460 --> 00:05:24,140 I have too much stuff in it.